<div style="padding: 25px;">
	<form class="layui-form layui-form-pane" method="post" action="">
	  
	  <div class="layui-form-item">
	    <label class="layui-form-label">名字</label>
	    <div class="layui-input-inline">
	      <input type="text" name="name" lay-verify="required" placeholder="子应用名称" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	  <div class="layui-form-item">
	    <label class="layui-form-label">页面地址</label>
	    <div class="layui-input-inline">
	      <input type="text" name="url" lay-verify="required" placeholder="节点 例：index/demo" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	  <div class="layui-form-item">
	    <label class="layui-form-label">类型</label>
	    <div class="layui-input-inline">
	      <select name="type" lay-filter="aihao">
	        <option value="0">普通页面</option>
	        <!-- <option value="1">数据表模板</option> -->
	        <option value="2">API接口</option>
	      </select>
	    </div>
	    <!-- <div class="layui-form-mid layui-word-aux"> <a href="">什么是数据表模板？</a></div> -->
	  </div>
	
	 <div class="layui-form-item">
	    <label class="layui-form-label">备注</label>
	    <div class="layui-input-block">
	      <input type="text" name="note" lay-verify="" placeholder="请输入" autocomplete="off" class="layui-input">
	    </div>
	  </div>

	  
	  
	  <div class="layui-form-item">
	    <button class="layui-btn" lay-submit="" lay-filter="addSonApp">保存</button>
	  </div>
	</form>
</div> 
<script>
//Demo
layui.use(['form','layer'], function(){
  var form = layui.form;
  var nav_bar=[
				{"type":"menu","url":"{:url('index/applist')}"},//或者{"type":"menu","url":"/admin/setting..."}
				{"type":"url","url":"{:url('index/sonapplist')}?appid="+enianAdmin.url().params.appid+"&appname="+enianAdmin.url().params.appname,"title":enianAdmin.url().params.appname+"子应用列表"},
				{"type":"url","url":"","title":"添加子应用"},
			]
	enianAdmin.render_nav_bar(nav_bar);
	form.render()
  //监听提交
	form.on('submit(addSonApp)', function(data){
	   // layer.msg(JSON.stringify(data.field));
	    //return false;
	    layui.$.post("{:url('',['t'=>1])}?appid={:input("param.appid")}",data.field, function(data) {
			if(data.code==1){
				layui.layer.msg('添加成功');
				enianAdmin.go(-1);
			}else{
				layui.layer.alert('添加失败')
			}
		});
		
		return false;
	});
});
</script>